<div class="form-container">
<div class="validation-errors" id="validationErrors" style="display:none;"></div>
<div class="walk-register-buttons" style="float: right;">
	<a href="<?php echo( base_url() ); ?>cmb/member/homepage_logout/<?php echo( $adminUrlKey ); ?>/"><img src="<?php echo( base_url() ); ?>assets/images/buttons/logout1.gif" border="0" /></a>
</div>
<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );
			
	echo( form_open(base_url() . 'annualbanquet/banquet_registration/admin_edit_banquet_registration_process/' .$bq_reg_history_id.'/', array('id' => 'adminEditBanquetRegForm') ) );

	Spacer::Render(0, 15);
	
	//Registration info
	//----------------------------------------
	Spacer::Render(0, 60);
	echo('<font color = "blue">'.$loggedinname.' is currently logged in</font>');
	Spacer::Render(0, 10);
	echo('<b>Registrant Info</b>');
	echo('<hr />');
	Form::OpenFormItem('Registrant First Name*:', 260);
		echo( form_input(array('name'=>'firstname','id'=>'firstname','value'=>$accountinfo->getFirstName(),'style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant Last Name*:', 260);
		echo( form_input(array('name'=>'lastname','id'=>'lastname','value'=>$accountinfo->getLastName(),'style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant Email*:', 260);
		echo( form_input(array('name'=>'email','id'=>'email','value'=>$accountinfo->getEmail(),'style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Confirm Registrant Email*:', 260);
		echo( form_input(array('name'=>'emailConfirm','id'=>'emailConfirm','value'=>$accountinfo->getEmail(),'maxlength'=>'127','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant Phone*: </br><font size="2" color="red">(xxx-xxx-xxxx)</font>', 260);
		echo( form_input(array('name'=>'phone','id'=>'phone','value'=>$accountinfo->getPhone(),'maxlength'=>'12','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant Address*:', 260);
		echo( form_input(array('name'=>'address','id'=>'address','value'=>$accountinfo->getAddress(),'maxlength'=>'127','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant City*:', 260);
		echo( form_input(array('name'=>'city','id'=>'city','value'=>$accountinfo->getCity(),'maxlength'=>'63','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant State*:', 260);
		$stateOptions = array(''=>'Select','AL'=>'Alabama','AK'=>'Alaska','AZ'=>'Arizona','AR'=>'Arkansas','CA'=>'California','CO'=>'Colorado','CT'=>'Connecticut','DE'=>'Delaware','DC'=>'District of Columbia','FL'=>'Florida','GA'=>'Georgia','HI'=>'Hawaii','ID'=>'Idaho','IL'=>'Illinois','IN'=>'Indiana','IA'=>'Iowa','KS'=>'Kansas','KY'=>'Kentucky','LA'=>'Louisiana','ME'=>'Maine','MD'=>'Maryland','MA'=>'Massachusetts','MI'=>'Michigan','MN'=>'Minnesota','MS'=>'Mississippi','MO'=>'Missouri','MT'=>'Montana','NE'=>'Nebraska','NV'=>'Nevada','NH'=>'New Hampshire','NJ'=>'New Jersey','NM'=>'New Mexico','NY'=>'New York','NC'=>'North Carolina','ND'=>'North Dakota','OH'=>'Ohio','OK'=>'Oklahoma','OR'=>'Oregon','PA'=>'Pennsylvania','RI'=>'Rhode Island','SC'=>'South Carolina','SD'=>'South Dakota','TN'=>'Tennessee','TX'=>'Texas','UT'=>'Utah','VT'=>'Vermont','VA'=>'Virginia','WA'=>'Washington','WV'=>'West Virginia','WI'=>'Wisconsin','WY'=>'Wyoming');
		echo( form_dropdown('state', $stateOptions, $accountinfo->getState(), 'id="state" style="width: 120px;" ') );
	Form::CloseFormItem();
	Form::OpenFormItem('Registrant Zip*:', 260);
		echo( form_input(array('name'=>'zip','id'=>'zip','value'=>$accountinfo->getZip(),'maxlength'=>'10','style'=>'width: 250px;')) );
	Form::CloseFormItem();												
	Form::OpenFormItem('Number of Adults:', 260);
		echo( form_input(array('name'=>'numadultreg','id'=>'numadultreg','value'=>$accountinfo->getNumAdultRegistered(),'maxlength'=>'2','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Number of children:', 260);
		echo( form_input(array('name'=>'numchildreg','id'=>'numchildreg','value'=>$accountinfo->getNumChildRegistered(),'maxlength'=>'2','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Donation:', 260);
		echo( form_input(array('name'=>'donationamount','id'=>'donationamount','value'=>$accountinfo->getDonation(),'maxlength'=>'10','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Payment Type:', 260);
		$paystatus = array('check'=>'check','paypal'=>'CreditCard');
		echo( form_dropdown('paymenttype', $paystatus, $accountinfo->getpaymentType(), 'id="paymenttype" style="width: 100px;"') );
	Form::CloseFormItem();
	Form::OpenFormItem('Check#:', 260);
		echo( form_input(array('name'=>'checknum','id'=>'checknum','value'=>$accountinfo->getCheckNum(),'maxlength'=>'16','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Credit Card TXN ID:', 260);
		echo( form_input(array('name'=>'paytxn','id'=>'paytxn','value'=>$accountinfo->getPaymentTransactionID(),'maxlength'=>'64','style'=>'width: 250px;')) );
	Form::CloseFormItem();
	Form::OpenFormItem('Payment Status:', 260);
		$paystatus = array('0'=>'Unpaid', '1'=>'Paid', '2'=>'Waiting');
		echo( form_dropdown('paymentstatus', $paystatus, $accountinfo->getPaymentStatus(), 'id="paymentstatus" style="width: 100px;"') );
	Form::CloseFormItem();
	Form::OpenFormItem('Comments:', 260);
		echo( form_textarea(array('name'=>'comments','id'=>'comments','value'=>$accountinfo->getComments(),'maxlength'=>'1024','rows'=>'15','cols'=>'80','style'=>'width: 400px;')) );
	Form::CloseFormItem();
	Form::OpenFormItemSummary('Registration Status:', 260);
		$paystatus = array('1'=>'Enabled', '0'=>'Disabled');
		echo( form_dropdown('regstatus', $paystatus, '', 'id="regstatus" style="width: 100px;"') );
	Form::CloseFormItem();

	echo( form_close() );
?>
	
	<div class="form-button-container">
		<a href="javascript: validate();"><img src="<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif" border="0" onmouseover="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_over1.gif';" onmousedown="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_on1.gif';" onmouseup="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif';" onmouseout="this.src = '<?php echo( base_url() );?>assets/images/buttons/submit_off1.gif';" /></a>
	</div>
</div>

<script type="text/javascript">
	function validate()
	{
		new Ajax.Request(baseUrl + 'validation/banquet_validation/validate_admin_edit_reg/', 
		{
			method:'post',
			parameters: Form.serialize( $('adminEditBanquetRegForm') ),
		  	onSuccess: function(response)
			{
				var result = response.responseText;
				
				if( result == 'VALIDATION_SUCCESS' )
				{
					$('adminEditBanquetRegForm').submit();
				}
				else
				{
					$('validationErrors').innerHTML = result;
					$('validationErrors').show();
					Effect.ScrollTo('validationErrors', { duration:'0.2', offset:-20 });
				}
			},
			onFailure: function(response){var result = response.responseText; $('validationErrors').innerHTML = result;
					$('validationErrors').show();alert('failed') }
		});
	}
</script>
